import request from '@/utils/request'

// 查询商品信息列表
export function listGoods(query) {
    return request({
        url: '/goods/goods/list',
        method: 'get',
        params: query
    })
}

// 查询商品信息详细
export function getGoods(id) {
    return request({
        url: '/goods/goods/' + id,
        method: 'get'
    })
}


// 新增商品信息
export function addGoods(data) {
    return request({
        url: '/goods/goods',
        method: 'post',
        data: data
    })
}

// 修改商品信息
export function updateGoods(data) {
    return request({
        url: '/goods/goods',
        method: 'put',
        data: data
    })
}

// 删除商品信息
export function delGoods(id) {
    return request({
        url: '/goods/goods/' + id,
        method: 'delete'
    })
}
//获取热销商品信息
export function selectHot(query) {
    return request({
        url: '/goods/goods/hot',
        method: 'get',
        params: query
    })
}
//获取积分商品信息
export function selectIntegral(query) {
    return request({
        url: '/goods/goods/integral',
        method: 'get',
        params: query
    })
}
//获分类商品信息
export function selectBySort(query) {
    return request({
        url: '/goods/goods/sort',
        method: 'get',
        params: query
    })
}